import request from '@/utils/request'

//添加商铺
export function add(data) {
  return request({
    url: 'api/shStoreProduct/add',
    method: 'post',
    data
  })
}
//所属店铺
export function getListByUser(params) {
  return request({
    url: 'api/shStore/getListByUser',
    method: 'get',
    params
  })
}
// 修改商铺
export function update(data) {
  return request({
    url: 'api/shStoreProduct/update',
    method: 'post',
    data
  })
}
// 商铺详情
export function getInfo(id) {
  return request({
    url: 'api/shStoreProduct/detail/' + id,
    method: 'get'
  })
}
//商品分类列表
export function getStoreCategoryList(params) {
  return request({
    url: 'api/getStoreCategoryList ',
    method: 'get',
    params
  })
}
//节点添加
export function nodeAdd(data) {
  return request({
    url: 'api/nodeManager/addChildNode',
    method: 'post',
    data
  })
}
//删除商品
export function del(data) {
  return request({
    url: 'api/shStoreProduct/delete' ,
    method: 'post',
    data
  })
}

//上下架
export function offOnShow(data) {
  return request({
    url: 'api/shStoreProduct/offOnShow' ,
    method: 'post',
    data
  })
}




















export function edit(data) {
  return request({
    url: 'api/yxStoreProduct',
    method: 'put',
    data
  })
}

export function updateShop(data) {
  return request({
    url: 'api/shStore/update',
    method: 'post',
    data
  })
}

export function shopGoods(data) {
  return request({
    url: 'api/shStore/list',
    method: 'post',
    data
  })
}
export function recovery(id) {
  return request({
    url: 'api/yxStoreProduct/recovery/' + id,
    method: 'delete'
  })
}

export function isFormatAttr(id, data) {
  return request({
    url: 'api/yxStoreProduct/isFormatAttr/' + id,
    method: 'post',
    data
  })
}

export function isFormatAttrForActivity(id, data) {
  return request({
    url: 'api/yxStoreProduct/isFormatAttrForActivity/' + id,
    method: 'post',
    data
  })
}
export function setAttr(id, data) {
  return request({
    url: 'api/yxStoreProduct/setAttr/' + id,
    method: 'post',
    data
  })
}

export function clearAttr(id) {
  return request({
    url: 'api/yxStoreProduct/clearAttr/' + id,
    method: 'post'
  })
}

export function getAttr(id) {
  return request({
    url: 'api/yxStoreProduct/attr/' + id,
    method: 'get'
  })
}
export function getArea(params) {
  return request({
    url: 'api/areaTree/getCityByCode',
    method: 'get',
    params
  })
}
export function getDistributableNodeLis(id) {
  return request({
    url: 'api/nodeManager/getDistributableNodeList/'+id,
    method: 'get',
  })
}


